#!/bin/bash

# JGit 构建脚本

echo "=== JGit 构建脚本 ==="
echo ""

# 检查Java版本
echo "检查Java版本..."
java -version 2>&1 | head -1

# 创建输出目录
echo ""
echo "创建输出目录..."
mkdir -p target/classes

# 编译Java文件
echo ""
echo "编译Java源代码..."
javac -d target/classes src/main/java/com/jgit/*.java

if [ $? -eq 0 ]; then
    echo "✓ 编译成功！"
    echo ""
    echo "编译后的class文件位于: target/classes/"
    echo ""
    echo "运行方式:"
    echo "  java -cp target/classes com.jgit.JGit <command>"
else
    echo "✗ 编译失败！"
    exit 1
fi

